package edu.sctu.practice.class02.xuqianlan.assign.assign01;

/**
 * Created by lenovo on 2015/10/22.
 */
public class Client {
    public static void main(String[] args) {
        System.out.println("圆：");
        Circle circle = new Circle("red", 3, 0);
        Client.displayGeometricObject(circle);


        System.out.println("长方形");
        Rectangle rectangle = new Rectangle("blue", 4, 5);
        Client.displayGeometricObject(rectangle);


        System.out.println("长方形和圆的面积是否相等：");
        System.out.println(Client.equalArea(rectangle, circle));
    }

    static boolean equalArea(GeometricObject object1, GeometricObject object2) {

        return object1.findArea() == object2.findArea();
    }

    static void displayGeometricObject(GeometricObject object) {
        System.out.println("颜色：" + object.color);
        System.out.println("面积：" + object.findArea());
        System.out.println("周长：" + object.findPerimeter());
    }


}



